package org.seedltd.upms.model.sys.form;

import lombok.Getter;
import lombok.Setter;
import org.hibernate.validator.constraints.Length;
import org.seedltd.core.validation.Save;
import org.seedltd.core.validation.Update;
import org.seedltd.upms.enums.EnableStatus;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;

/**
 * 控制器
 *
 * @author laizuan
 * @version 1.0
 * @since 2020/08/06
 */
@Getter
@Setter
public class SysParamForm {


    /**
     * 参数主键
     */
    @NotNull(message = "参数主键不能为空", groups = {Update.class})
    private Long paramId;


    /**
     * 参数key
     */
    @Length(message = "参数key长度不能超过25个字符", max = 25, groups = {Save.class})
    @NotBlank(message = "参数key不能为空", groups = {Save.class})
    private String paramKey;


    /**
     * 参数值
     */
    @Length(message = "参数值长度不能超过200个字符", max = 200, groups = {Save.class})
    @NotBlank(message = "参数值不能为空", groups = {Save.class})
    private String paramValue;


    /**
     * 启用状态(1启用 0禁用)
     */
    @NotNull(message = "启禁用状态不能为空", groups = {Save.class})
    private EnableStatus enabled;


    /**
     * 备注
     */
    @Length(message = "备注长度不能超过100个字符", max = 100, groups = {Save.class})
    private String remark;
}
